<%var obj={pageTitle:"绑定账号"}%>
{{include "../header.html"}}
<div class=" container">
    <div class=" page-header">
        <h2 class=" text-center text-primary">绑定账号</h2>
    </div>
    <div class=" row">
        <div class=" col-sm-6 col-sm-offset-3">
            <ul class=" nav nav-tabs nav-justified">
                <li class="active"><a href="#newUser" data-toggle="tab">绑定新账号</a></li>
                <li><a href="#oldUser" data-toggle="tab">绑定已有账号</a></li>
            </ul>
            <div class=" tab-content" style="margin-top:20px">
                <!--绑定新账号-->
                <div class=" tab-pane fade in active" id="newUser">
                    <form id="newUserForm" class="" action="/Admin/bindNewUser" method="POST" enctype="application/x-www-form-urlencoded">
                        <input type="hidden" name="openid" value="{{model.openid}}">


                        <div class=" form-group">
                            <div class=" input-group">
                                <span class=" input-group-addon">账号</span>
                                <input type="text" name="u_id" class=" form-control" placeholder="请输入账号">
                            </div>
                        </div>
                        <div class=" form-group">
                            <div class=" input-group">
                                <span class=" input-group-addon">姓名</span>
                                <input type="text" name="u_name" class=" form-control" placeholder="请输入姓名">
                            </div>
                        </div>
                        <div class=" form-group">
                            <div class=" input-group">
                                <span class=" input-group-addon">密码</span>
                                <input password="text" name="u_password" class=" form-control" placeholder="请输入密码" id="f_pwd">
                            </div>
                        </div>
                        <div class=" form-group">
                            <div class=" input-group">
                                <span class=" input-group-addon">确认密码</span>
                                <input type="password" name="u_password_s" class=" form-control" placeholder="请再次输入密码" id="s_pwd">
                            </div>
                        </div>


                        <div class=" form-group">
                                <button type="submit" class=" btn btn-info btn-block btn-bind-newUser">绑定账号</button>
                            
                        </div>
                    </form>
                </div>

                <!--绑定已有账号-->
                <div class=" tab-pane " id="oldUser">
                    <form id="oldUserrForm" class="" method="POST" action="/Admin/bindOldUser" enctype="application/x-www-form-urlencoded">
                        <input type="hidden" name="openid" value="{{model.openid}}">
                        <div class=" form-group">
                            <div class=" input-group">
                                <span class=" input-group-addon">账号</span>
                                <input type="text" name="u_id" class=" form-control" placeholder="请输入用户名">
                            </div>

                        </div>

                        <div class=" form-group">
                            <div class=" input-group">
                                <span class=" input-group-addon">密码</span>
                                <input type="password" name="u_password" class=" form-control" placeholder="请输入密码">
                            </div>
                        </div>

                        <div class=" form-group">
                            <button type="submit" class=" btn btn-info btn-block btn-bind-oldUser">绑定账号</button>

                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $(".btn-bind-newUser").click(function () {
            if ($("#f_pwd").val() != $("#s_pwd").val()) {
                layer.open({
                    title: '提示',
                    content: '两次密码不一致！！！'
                });
                $("#f_pwd,#s_pwd").val("");
                return false;
            }
        });
    });
</script>


{{include "../footer.html"}}